package com.ly;

/**
 * @author LY
 * @date 2021年03月22日 13:27
 * @project test
 */
public class Test {
    private int i;

    public static void main(String[] args) throws NoSuchMethodException, InterruptedException {
//        int a = 5;
//        int b = 4;
//        int c = a++- --b*++a/b-- >>2%a--;
//        System.out.println(c);
//        ThreadMXBean mxBean = ManagementFactory.getThreadMXBean();
//        ThreadInfo[] threadInfos = mxBean.dumpAllThreads(false, false);
//        for (ThreadInfo threadInfo : threadInfos) {
//            System.out.println("["+threadInfo.getThreadId()+"]"+threadInfo.getThreadName());
//        }

        Thread threadSleep = new Thread(()->{
            while (true){
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread threadBusy = new Thread(()->{
            while (true){
            }
        });
        threadSleep.start();
        threadBusy.start();
        Thread.sleep(200);

        threadSleep.interrupt();
        threadBusy.interrupt();

        System.out.println("threadSleep isInterrupted :"+threadSleep.isInterrupted());
        System.out.println("threadBusy isInterrupted :"+threadBusy.isInterrupted());
        Thread.sleep(1000);
    }

}


